import random

daizi=[[],[],[]]
qiu=[1,2,3,4,5,6,7,8,9]
for q in qiu:
    index = random.randint(0,2)
    daizi[index].append(q)
i=1
for d in daizi:
    print("背包%d里的球的个数为:%d"%(i,len(d)))
    i +=1
    for j in d :
        print("%d"%j,end="\t")
    print()
